package com.story.story_serve.controller.Book;

import com.story.story_pojo.Book.Bmypage;
import com.story.story_pojo.Book.BookDetails;
import com.story.story_serve.service.Book.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import com.story.story_pojo.Book.Book;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * ClassName:  BookController
 * description:
 *
 * @ author:郭海龙
 * @ Create：2024/6/2 20:07
 * @ Version:1.0
 */
@RestController
public class BookController {
    @Autowired
    private BookService bookService;

    // 获取top12高分电影
    @RequestMapping("/getTop12Book")
    public List<Book> getBook() {
        return bookService.getTop12Book();
    }

    // 获取小说的翻页数据
    @RequestMapping("/getAllBook")
    public Map<String, Object> getAllBook(Bmypage bmypage) {
        return bookService.pageBook(bmypage);
    }

    //  详情页数据
    @RequestMapping("/getBookById")
    public Book getBookById(Book book){
        return bookService.getBookById(book);
    }

    // 详情页目录数据
    @RequestMapping("/getDetailsById")
    public List<BookDetails> getDetailsById(Book book){
        return bookService.getDetailsById(book);
    }

}
